package cn.shujuhai.common.service;

import com.google.common.util.concurrent.RateLimiter;
import org.springframework.stereotype.Service;

@Service
public class RateLimitService {
    private final RateLimiter rateLimiter = RateLimiter.create(200); // 每秒最多100次

    public boolean tryAcquire() {
        return rateLimiter.tryAcquire();
    }
}